# encoding: utf-8
class SearchOrdering():
    by_participants = 1
    by_cost_per_user = 2
    by_cost = 3
    by_name = 4
    
    ordering = ((by_participants, 'по популярности'), \
                (by_cost_per_user, 'по стоимости'), \
                (by_cost, 'по общей стоимости'), \
                (by_name, 'по названию'))
    
    
def is_user_authenticated(request):
    return request.session.has_key('user_id')